package henu.factory;

import org.apache.commons.dbutils.QueryRunner;

import henu.dao.ICommunictorDao;
import henu.dao.IEduClassDao;
import henu.dao.IFeedBackDao;
import henu.dao.ILessonDao;
import henu.dao.INoticeDao;
import henu.dao.IScheduleDao;
import henu.dao.ISchooltimetableDao;
import henu.dao.ITClassDao;
import henu.dao.ITeacherDao;
import henu.dao.IUserDao;
import henu.dao.impl.CommunictorDaoImpl;
import henu.dao.impl.EduClassDaoImpl;
import henu.dao.impl.FeedBackDaoImpl;
import henu.dao.impl.LessonDaoImpl;
import henu.dao.impl.NoticeDaoImpl;
import henu.dao.impl.ScheduleDaoImpl;
import henu.dao.impl.SchooltimetableDaoImpl;
import henu.dao.impl.TClassDaoImpl;
import henu.dao.impl.TeacherDaoImpl;
import henu.dao.impl.UserDaoImpl;
import henu.util.Dhcp;
/**
 * DAO工厂类
 * @author 梁胜彬
 * 2016年9月10日
 */
public class DaoFactory {

	public static QueryRunner queryRunner = new QueryRunner(Dhcp.getDataSource());
	/**
	 * 创建用户DAO实现类
	 * @return
	 */
	public static IUserDao createUserDao()
	{
		return new UserDaoImpl(queryRunner);
	}
	
	public static ICommunictorDao createCommunictorDao(){
		return new CommunictorDaoImpl(queryRunner);
	}
	
	public static IEduClassDao createEduClassDao()
	{
		return new EduClassDaoImpl(queryRunner);
	}
	
	public static IFeedBackDao createFeedBackDao()
	{
		return new FeedBackDaoImpl(queryRunner);
	}
	
	public static ILessonDao createLessonDao()
	{
		return new LessonDaoImpl(queryRunner);
	}
	
	public static ISchooltimetableDao createSchooltimetableDao()
	{
		return new SchooltimetableDaoImpl(queryRunner);
	}
	
	public static ITClassDao createTClassDao()
	{
		return new TClassDaoImpl(queryRunner);
	}
	
	public static ITeacherDao createTeacherDao()
	{
		return new TeacherDaoImpl(queryRunner);
	}
	
	public static IScheduleDao createScheduleDao(){
		return new ScheduleDaoImpl(queryRunner);
	}
	
	public static INoticeDao createNoticeDao(){
		return new NoticeDaoImpl(queryRunner);
	}
}
